package org.example.springbookdemo.controller;

import org.example.springbookdemo.model.BookInfo;
import org.example.springbookdemo.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * @author: Themberfue
 * @date: 2025/1/22 12:51
 * @description:
 */
@RequestMapping("/book")
@RestController
public class BookController {
    // ? 从spring中获取该对象，并给属性赋值，前提是该对象已经被spring管理
    @Autowired
    BookService bookService;

    @RequestMapping("/getBookList")
    public List<BookInfo> getBookList() {
        return bookService.getBookList();
    }
}
